﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Drawing;
using System.Windows.Forms;
using SGP;


namespace AnimationEditor  
{
    class SpriteSheetWindow : System.Windows.Forms.PictureBox
    {
        //Rectangle CollisionRect = new Rectangle();
        //Rectangle SourceRectAngle = new Rectangle(); 

        //Render Override
        public void Render(int ImageID, Point Offset)
        {

            //Rectangle temprect = new Rectangle(0,0,5000,5000);
            SGP.CSGP_TextureManager.GetInstance().Draw(ImageID, -Offset.X, -Offset.Y);
        }

        public void RenderBoxes(Frame SelectedFrame, Point Offset)
        {

            //Modif SourceRect
            Rectangle TempSourceRect = SelectedFrame.SourceRect1;
            TempSourceRect.X -= Offset.X;
            TempSourceRect.Y -= Offset.Y;

            //Modif ColRect
            Rectangle TempColRect = SelectedFrame.CollisionRect1;
            TempColRect.X -= Offset.X;
            TempColRect.Y -= Offset.Y;

            SGP.CSGP_Direct3D.GetInstance().DrawHollowRect(TempSourceRect, Color.Blue, 2);
            SGP.CSGP_Direct3D.GetInstance().DrawHollowRect(TempColRect, Color.Red, 2);
        }
    }
}
